import React,{useEffect} from 'react'
import {useSelector,useDispatch} from "react-redux"
import * as action from "../../action"
import Style from "../../style/style.module.css"
import {debounce} from "lodash"
import axios from 'axios'
function OnlineReta() {
  console.log(Style,123);
  let fn = (data)=>{
    axios.post("http://172.16.10.111:8089/exam_admin_report/tgjf/tgjfbjcjd/doLoadJsValidate.do").then(res=>{
      console.log(res.data);
    })
   

  }
  console.log(action); // action 是一个modal
  let dispatch = useDispatch()
  // let store = useSelector((state)=>{
  //   return {
  //     ...state.homereducer
  //   }
  // })
  useEffect(()=>{
    dispatch(action.getlist())
  },[])
  let store = useSelector(state=>({...state.homereducer}))
 console.log(store);
  return (
    <div className={Style.homeWrapper}>
      <h1>{store.name}</h1>
      <button onClick={debounce(()=>{fn()},2000,{
  // 'leading': false,
   'trailing': true
})}>点击下载安装包</button>
    </div>
  )
}

export default OnlineReta